-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
invoke V3 #1530
Open
jbcaron
wants to merge
1
commit into
kkrt-labs:main
Choose a base branch
from
jbcaron:feat/invoke_v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
invoke V3 #1530
+139
−29
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jbcaron
requested review from
ClementWalter,
Eikix and
greged93
as code owners
November 6, 2024 17:04
jbcaron
force-pushed
the
feat/invoke_v3
branch
from
November 6, 2024 17:06
4aaec6e
to
0c08533
Compare
It seems for rust tests, the katana accounts are not funded in STRK? |
Eikix
reviewed
Nov 7, 2024
Eikix
reviewed
Nov 7, 2024
Eikix
reviewed
Nov 7, 2024
jbcaron
force-pushed
the
feat/invoke_v3
branch
from
November 7, 2024 13:20
0c08533
to
cc299e0
Compare
tcoratger
reviewed
Nov 8, 2024
Comment on lines
+55
to
+75
impl TryFrom<Felt252Wrapper> for u64 { | ||
type Error = EthereumDataFormatError; | ||
|
||
fn try_from(felt: Felt252Wrapper) -> Result<Self, Self::Error> { | ||
match felt.to_be_digits() { | ||
[0, 0, 0, d] => Ok(d), | ||
_ => Err(EthereumDataFormatError::Primitive), | ||
} | ||
} | ||
} | ||
|
||
impl TryFrom<Felt252Wrapper> for u128 { | ||
type Error = EthereumDataFormatError; | ||
|
||
fn try_from(felt: Felt252Wrapper) -> Result<Self, Self::Error> { | ||
match felt.to_be_digits() { | ||
[0, 0, d1, d2] => Ok(Self::from(d1) << 64 | Self::from(d2)), | ||
_ => Err(EthereumDataFormatError::Primitive), | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use directly this
by doing something like
let a = Felt252Wrapper;
let b: u64 = a.0.try_into().expect("");
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Time spent on this PR:
Resolves: #773
Pull Request type
Please check the type of change your PR introduces:
What is the new behavior?
Does this introduce a breaking change?